﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;

namespace WaveMaster.Holidays.Club.Domain
{
    public class Passenger
    {
        public long m_passangerID;
        public CheckIn m_booking;
        public Passport m_passport;
        public string m_ticketNo;
        public string m_boardingPassCode;
        public PassengerStatus m_passengerStatus = PassengerStatus.CheckIn;
        public bool Edited = false;

        public string m_passportNo;
        public DateTime m_issueDate;
        public DateTime m_expireDate;
        public string m_country;
        public string m_officeIssue;
        public string m_name;
        public string m_gender;
        public string m_birthPlace;
        public DateTime m_birthDate;
        public string m_nationality;
        public string m_placeOfResidence;
        public string m_occupation;
        public string m_maritalStatus;
        public string m_address;
        public string m_city;
        public string m_zipcode;
        public string m_remark;
        public string m_idnumber;
        public TravelAgent m_travelAgent;


        public Passenger PassangerHistory;


        public Passenger() { }
        public Passenger(MySqlDataReader rd ) 
        {
            m_passangerID = Convert.ToInt64(rd["m_passangerID"]);
            m_booking = new CheckIn(Convert.ToInt64(rd["m_bookingID"]));
            m_passport = new Passport(Convert.ToInt64(rd["m_passportID"]));
            m_ticketNo = rd["m_ticketNo"].ToString();
            m_boardingPassCode = rd["m_boardingPassCode"].ToString();
            m_passengerStatus = (PassengerStatus)Enum.Parse(typeof(PassengerStatus), rd["m_passengerStatus"].ToString());

            m_passportNo = rd["m_passportNo"].ToString();
            m_issueDate = Convert.ToDateTime(rd["m_issueDate"]);
            m_expireDate = Convert.ToDateTime(rd["m_expireDate"]);
            m_country = rd["m_country"].ToString();
            m_officeIssue = rd["m_officeIssue"].ToString();
            m_name = rd["m_name"].ToString();
            m_gender = rd["m_gender"].ToString();
            m_birthPlace = rd["m_birthPlace"].ToString();
            m_birthDate = Convert.ToDateTime(rd["m_birthDate"]);
            m_nationality = rd["m_nationality"].ToString();
            m_placeOfResidence = rd["m_placeOfResidence"].ToString();
            m_occupation = rd["m_occupation"].ToString();
            m_maritalStatus = rd["m_maritalStatus"].ToString();
            m_address = rd["m_address"].ToString();
            m_city = rd["m_city"].ToString();
            m_zipcode = rd["m_zipcode"].ToString();
            m_remark = rd["m_remark"].ToString();
            m_idnumber = rd["m_idnumber"].ToString();
            m_travelAgent = new TravelAgent(Convert.ToInt64(rd["m_travelAgentId"]));

        }

    }
}
